<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>探戈坞音乐谷社区-<%= @html_title %></title>
    <meta name="description" content="探戈坞音乐谷社区-<%= @html_description %>" />
<%# 公用的css和javascript %>
    <%= javascript_include_tag  :defaults  %>
    <%= stylesheet_link_tag 'valleyer/base', 'valleyer/error_message'  %>
    <%= yield :css %>
    <%= yield :javascript %>
  </head>
<%# 头部%>
  <body>
    <script type="text/javascript">
      //选项卡高亮和低亮
      function buttonHighOrLow(id)
      {
        $$('a.button_h').each(
        function(a) {
          a.className = 'button_l';
          a.style.fontWeight = 'normal';
        });
        $(id).className = 'button_h';
        $(id).style.fontWeight = 'bold';

        $$('.navlet').each(
        function(a) {
          a.style.display = 'none';
        });
        $(id + "_mainstay").style.display = 'inline';
      }

      //导航栏高亮和低亮
      function nav_barHighOrLow(id)
      {
        $$('a.h').each(
        function(a) {
          a.className = 'l';
        });
        $(id).className = 'h';
      }

      //翻页器赋值
      function page_tumer(cmd, page_number)
      {
        $(cmd + "_page_number").value = page_number;
        $(cmd + "_page_tumer").onsubmit();
      }
    </script>

    <div id="integer">
      <div id="head">
        <div class="nav_bar">
          <%= link_to "社区首页",
            home_url(:default ,:cmd => :home),
            :id => :home,
            :class => :h
        %><b>|</b>
          <% if loggined_by_valleyer? %>
            <%= link_to "个人主页",
              valleyer_url(:id => current_valleyer.id, :cmd => :valleyer),
              :id => :valleyer,
              :class => :l
          %><b>|</b>
            <%= link_to "好友",
              friend_ships_url(:cmd => :friend),
              :id => :friend,
              :class => :l
          %><b>|</b>
          <% end %>
          <!--<a href="http://localhost:3000/demo/valleyer/group/groupPage">群体</a><b>|</b>
          <a href="http://localhost:3000/demo/valleyer/exercise/exercisePage">活动</a><b>|</b>
          <a href="javascript:;">动态</a><b>|</b>-->
          <%= link_to "文档",
            document_url(:default, :cmd => :document),
            :id => :document,
            :class => :l
        %><b>|</b>
          <%= link_to "会员",
            member_url(:default, :cmd => :member),
            :id => :member,
            :class => :l
        %>
          <% if loggined_by_valleyer? %>
            <% if loggined_by_admin? %>
              <b>|</b>
              <%= link_to "后台管理",
                back_stage_url(:id => current_valleyer.id),
                :id => :back_stage,
                :class => :l,
                :target => :_blank
            %>
            <% end %>
          <% end %>
          <b>|</b>
          <%= link_to "探戈坞首页",
            "http://www.chinatanglewood.com/cn/index.asp",
            :target => :_blank
        %>
          <% if loggined_by_valleyer? %>
            <!--登录信息-->
            <%= link_to "注销",
              homes_show_session_url(:id => :cancellation),
              :method => :delete,
              :class => :cancellation,
              :title => '退出登录状态'
          %><p>|</p>
            <%= link_to current_valleyer.nick_name,
              valleyer_url(current_valleyer),
              :target => :_blank,
              :class => :current_valleyer_name,
              :title => current_valleyer.nick_name
          %>
            <% if current_valleyer.any_new_friend_apply? %>
              <%= link_to image_tag("valleyer/friend_apply.gif"),
                friend_ships_url(:cmd => :friend_apply),
                :target => :_blank,
                :class => :have_apply,
                :title => "有#{current_valleyer.new_friend_applies.size}个谷友想与你交往哟",
                :id => 'new_friend_apply'
            %>
              <script type="text/javascript">
                Effect.Pulsate('new_friend_apply', { pulses: 120000, duration: 120000 });
              </script>
            <% end %>
          <% end %>
        </div>
      </div>
      <div id="center">
        <%= yield %>
      </div>
<%# 底部%>
      <div id="bottom"></div>
    </div>
  </body>
</html>
<script type="text/javascript">
<% if params[:cmd] == "home" %>
    nav_barHighOrLow("home");
<% end %>

<% if params[:cmd] == "valleyer" %>
    nav_barHighOrLow("valleyer");
<% end %>

<% if params[:cmd] == "friend" %>
    nav_barHighOrLow("friend");
<% end %>

<% if params[:cmd] == "document" %>
    nav_barHighOrLow("document");
<% end %>
<% if params[:cmd] == "member" %>
    nav_barHighOrLow("member");
<% end %>
</script>